package com.wteam.controller;


import com.wteam.PoJo.DTO.PageQuery;
import com.wteam.PoJo.DTO.UpUserDTO;
import com.wteam.PoJo.DTO.followotherDTO;
import com.wteam.PoJo.VO.favsuserVO;
import com.wteam.Service.IFollowsService;
import com.wteam.until.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 关注记录表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-07-16
 */
@RestController
@RequestMapping("/follows")
@Api(tags = "关注模块")
public class FollowsController {
    @Autowired
    private IFollowsService iFollowsService;

    @ApiOperation(value = "关注别人")
    @PostMapping("/followother")
    public Result followother(@RequestBody  followotherDTO followotherDTO){

        return iFollowsService.followother(followotherDTO);
    }

    @ApiOperation(value = "取消关注别人")
    @PostMapping("/cancelfollow")
    public Result cancelfollow(@RequestBody  followotherDTO followotherDTO){

        return iFollowsService.cancelfollow(followotherDTO);
    }

    @ApiOperation(value = "查看我的关注")
    @GetMapping("/listfollow")
    public Result<List<favsuserVO> > listfollow(@ApiParam("只用填page和pagesize") PageQuery pageQuery){
        return iFollowsService.listfollow(pageQuery);
    }


    @ApiOperation(value = "查看我的粉丝")
    @GetMapping("/followme")
    public Result<List<favsuserVO>> followme(@ApiParam("只用填page和pagesize") PageQuery pageQuery){
        return iFollowsService.followme(pageQuery);
    }
    @ApiOperation(value = "查看互关")
    @GetMapping("/togerfoller")
    public Result <  List<favsuserVO>>togerfoller(@ApiParam("只用填page和pagesize") PageQuery pageQuery){
        return iFollowsService.togerfoller(pageQuery);
    }

}
